package com.example.administrator.fishbone.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by ${杨文超} on 2016/9/2.
 */
public class DBOpenHeldper extends SQLiteOpenHelper{

    public DBOpenHeldper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        //执行创建表的语句
        String createSql = "create table \"NewTask\"(\n" +
                "_id INTEGER PRIMARY KEY AUTOINCREMENT,"+
                "       last_name NVARCHAR,\n" +
                "       title NVARCHAR,\n" +
                "       content NVARCHAR,\n" +
                "       time NVARCHAR,\n" +
                "       name NVARCHAR,\n" +
                "       number NVARCHAR,\n" +
                "       Data1 NVARCHAR,\n" +
                "       Data2 NVARCHAR\n" +
                ")";
        db.execSQL(createSql);
        Log.v("tsh","on create");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
